
package com.yesep.learn.mqtt.client.handler.protocol;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.yesep.learn.mqtt.client.common.event.EventType;
import com.yesep.learn.mqtt.client.common.util.ChannelUtil;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.mqtt.MqttMessage;

/**
   * 消息编号：7
 * @Description: PUBCOMP连接处理，发布完成，保证传递3
 */
public class PubComp {

	private static final Logger logger = LoggerFactory.getLogger(PubComp.class);

	public void process(ChannelHandlerContext ctx, MqttMessage message) {
		ChannelUtil.triggerUserEvent(ctx, EventType.PUBLISH_SUCCESS, message);
		logger.info("publish success : {}", ChannelUtil.clientId(ctx.channel()));
	}
}
